#pragma once
#ifndef __G_RECTANGLE_ALIGNED_H__
#define __G_RECTANGLE_ALIGNED_H__

#include "GVector2.h"
#include "GRectangleOriented.h"
#include "GUtilities/GTypes.h"

namespace GMath
{

	class GRay2;
	class GCircle;
	class GTriangle2;

	class GRectangleAligned
	{

	public:
		const static GRectangleAligned	UnitRectangle;

		GVector2			Min;
		GVector2			Max;

							GRectangleAligned();
							GRectangleAligned(const GVector2& TheMin, const GVector2& TheMax);
							GRectangleAligned(const GVector2& Center, float Width, float Height);

		void				Create(const GVector2& TheMin, const GVector2& TheMax);
		void				Create(const GVector2& Center, float Width, float Height);

		GVector2			GetDimension() const;
		const GVector2&		GetCenter() const;

		const GVector2&		GetUp() const;
		const GVector2&		GetRight() const;

		float				Area() const;
		float				Circumference() const;

		void				GetCorners(OUTPUT GVector2 Arr[G_RC_COUNT]) const;
		GVector2			GetCorner(GRectangleCorner Corner) const;

		void				Combine(const GRectangleAligned& Rect);
		static void			Combine(OUTPUT GRectangleAligned& OutRect, const GRectangleAligned& Rect1, const GRectangleAligned& Rect2);

		static void			Convert(OUTPUT GRectangleAligned& OutRect, const GRectangleOriented& Rect);
		static void			Convert(OUTPUT GRectangleOriented& OutRect, const GRectangleAligned& Rect);
	
		const GRectangleAligned& operator = (const GRectangleAligned& Other);

	};

}

#endif